using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace HappySprite
{
    public static class Vector2Extensions
    {
        public static Vector2 Cross(float s, Vector2 a)
        {
            return new Vector2(-s * a.Y, s * a.X);
        }

        public static Vector2 Cross(Vector2 a, float s)
        {
            return new Vector2(s * a.Y, -s * a.X);
        }

        public static float Cross(Vector2 a, Vector2 b)
        {
            return a.X * b.Y - a.Y * b.X;
        }

        public static void Cross(ref float s, ref Vector2 a, out Vector2 value)
        {
            value.X = -s * a.Y;
            value.Y = s * a.X;
        }

        public static void Cross(ref Vector2 a, ref float s, out Vector2 value)
        {
            value.X = s * a.Y;
            value.Y = -s * a.X;
        }

        public static void Cross(ref Vector2 a, ref Vector2 b, out float value)
        {
            value = a.X * b.Y - a.Y * b.X;
        }
    }
}
